cmake_minimum_required (VERSION 2.6)

project (LineClear)

set(CMAKE_MODULE_PATH "/opt/local/lib/cmake") 
set(CMAKE_BUILD_TYPE Debug)

set(LineClear_VERSION_MAJOR 1)
set(LineClear_VERSION_MINOR 0)
set(LineClear_SOURCES main.cpp Environment.cpp ChoiceTree.cpp ChoiceSet.cpp  CutSequence.cpp Cut.cpp)
set(LineClear_HEADERS Environment.h ChoiceTree.h ChoiceSet.h CutSequence.h Cut.h)

set(LineClearGui_SOURCES Gui.cpp Gui_main.cpp Environment.cpp ChoiceTree.cpp ChoiceSet.cpp  CutSequence.cpp Cut.cpp)
set(LineClearGui_HEADERS Gui.h Environment.h ChoiceTree.h ChoiceSet.h CutSequence.h Cut.h)


find_package(CGAL COMPONENTS Qt4)
include( ${CGAL_USE_FILE} )

set( QT_USE_QTXML    TRUE )
set( QT_USE_QTMAIN   TRUE )
set( QT_USE_QTSCRIPT  TRUE )
set( QT_USE_QTOPENGL  TRUE )

find_package(Qt4 REQUIRED)
INCLUDE(${QT_USE_FILE})
ADD_DEFINITIONS(${QT_DEFINITIONS})

QT4_WRAP_CPP(LineClearGui_HEADERS_MOC ${LineClearGui_HEADERS})


if ( CGAL_FOUND AND CGAL_Qt4_FOUND AND QT4_FOUND )
    add_executable(LineClear ${LineClear_SOURCES} )
    target_link_libraries( LineClear ${QT_LIBRARIES})
    target_link_libraries( LineClear ${CGAL_LIBRARIES}  
        ${CGAL_3RD_PARTY_LIBRARIES})

    add_executable(LineClearGui ${LineClearGui_SOURCES} ${LineClearGui_HEADERS_MOC})
    target_link_libraries( LineClearGui ${QT_LIBRARIES})
    target_link_libraries( LineClearGui ${CGAL_LIBRARIES}  
        ${CGAL_3RD_PARTY_LIBRARIES})

else()
  message(STATUS "Shit hit the fan.")
endif()
